#include "dialog_time.h"

#include "lcd_driver.h"

TimeDialog::TimeDialog(HWND parent):Dialog(parent)
{
    name ="page 2";
    
    setupWidgets();
    
}

TimeDialog::~TimeDialog()
{
}

/** @function setupWidgets
 *  @brief    setwidgets' parent to this
 *            draw widgets
 */
void TimeDialog::setupWidgets()
{
    pEdit1 =new Edit(this, "123456");
    pEdit1->name ="Edit 1";
    pEdit1->setPosition(1,0);
    
    pEdit2 = new Edit(this, "abcdefg");
    pEdit2->name ="Edit 2";
    
    pEdit2->setPosition(1,20);
    
    pEdit2->setText("edit2demostringabcdef");
    
}

void TimeDialog::cleanWidgets()
{
    delete pEdit2;
    delete pEdit1;
}


void TimeDialog::draw(Rect *r)
{
    pDC->dirty(max(r->x0,rect.x0), max(r->y0,rect.y0), min(r->x1,rect.x1), min(r->y1,rect.y1));
    Widget::draw(r);
}



